<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <div>
        <p></p>
        <p></p>
        <p></p>
    </div>
    
    <script src="d3.min.js"></script>
    <script>
       const div = d3.select('div');
       //div.append('p');
       div.remove();
       const ps = div.selectAll('p');
    </script>
</body>
</html>